﻿namespace WMS6.Web.Analytics
{
    using System;
    using System.Web.UI.HtmlControls;
    using System.Web.UI.WebControls;
    using WMS6.Web;

    public class OwnerTransferRptQuery : BasePage
    {
        protected Button btnSearch;
        protected DropDownList ddlFromDescr;
        protected DropDownList ddlFromOwnerID;
        protected DropDownList ddlFromSkuID;
        protected DropDownList ddlToDescr;
        protected DropDownList ddlToOwnerID;
        protected DropDownList ddlToSkuID;
        protected DropDownList ddlTransferDate;
        protected DropDownList ddlTransferID;
        protected HtmlForm F15340;
        protected HtmlInputHidden hdnActionID;
        protected HtmlInputHidden hdncalendarFlag;
        protected HtmlInputHidden hdnDataFormat;
        protected HtmlImage img2;
        protected Label lblFromDescr;
        protected Label lblFromOwnerID;
        protected Label lblFromSkuID;
        protected Label lblToDescr;
        protected Label lblToOwnerID;
        protected Label lblToSkuID;
        protected Label lblTransferDate;
        protected Label lblTransferID;
        protected HtmlLink mycss;
        protected Label one1;
        protected TextBox txtFromDescr;
        protected TextBox txtFromOwnerID;
        protected TextBox txtFromSkuID;
        protected TextBox txtToDescr;
        protected TextBox txtToOwnerID;
        protected TextBox txtToSkuID;
        protected TextBox txtTransferDate;
        protected TextBox txtTransferDate2;
        protected TextBox txtTransferID;

        protected void btnSearch_Click(object sender, EventArgs e)
        {
            base.Server.Transfer("OwnerTransferRptList.aspx", false);
        }

        private void InitDropDownLists()
        {
            base.InitQueryDDL(this.ddlFromOwnerID, 0);
            base.InitQueryDDL(this.ddlFromDescr, 0);
            base.InitQueryDDL(this.ddlFromSkuID, 0);
            base.InitQueryDDL(this.ddlToDescr, 0);
            base.InitQueryDDL(this.ddlToOwnerID, 0);
            base.InitQueryDDL(this.ddlToSkuID, 0);
            base.InitQueryDDL(this.ddlTransferID, 0);
            base.InitQueryDDL(this.ddlTransferDate, 1);
        }

        protected void Page_Load(object sender, EventArgs e)
        {
            if (!base.IsPostBack)
            {
                base.InitPage(this.Page);
                this.InitDropDownLists();
            }
        }

        public string FromDescr
        {
            get
            {
                if (!string.IsNullOrEmpty(this.txtFromDescr.Text.Trim()))
                {
                    return base.GetParamsString(this.txtFromDescr.Text.Trim(), this.ddlFromDescr.SelectedValue);
                }
                return "";
            }
        }

        public string FromOwnerID
        {
            get
            {
                if (!string.IsNullOrEmpty(this.txtFromOwnerID.Text.Trim()))
                {
                    return base.GetParamsString(this.txtFromOwnerID.Text.Trim(), this.ddlFromOwnerID.SelectedValue);
                }
                return "";
            }
        }

        public string FromSkuID
        {
            get
            {
                if (!string.IsNullOrEmpty(this.txtFromSkuID.Text.Trim()))
                {
                    return base.GetParamsString(this.txtFromSkuID.Text.Trim(), this.ddlFromSkuID.SelectedValue);
                }
                return "";
            }
        }

        public string ToDescr
        {
            get
            {
                if (!string.IsNullOrEmpty(this.txtToDescr.Text.Trim()))
                {
                    return base.GetParamsString(this.txtToDescr.Text.Trim(), this.ddlToDescr.SelectedValue);
                }
                return "";
            }
        }

        public string ToOwnerID
        {
            get
            {
                if (!string.IsNullOrEmpty(this.txtToOwnerID.Text.Trim()))
                {
                    return base.GetParamsString(this.txtToOwnerID.Text.Trim(), this.ddlToOwnerID.SelectedValue);
                }
                return "";
            }
        }

        public string ToSkuID
        {
            get
            {
                if (!string.IsNullOrEmpty(this.txtToSkuID.Text.Trim()))
                {
                    return base.GetParamsString(this.txtToSkuID.Text.Trim(), this.ddlToSkuID.SelectedValue);
                }
                return "";
            }
        }

        public string TransferDate
        {
            get
            {
                if (!string.IsNullOrEmpty(this.txtTransferDate.Text.Trim()))
                {
                    return base.GetParamsString(Convert.ToDateTime(this.txtTransferDate.Text).ToString("yyyy-MM-dd") + " 00:00:00", this.ddlTransferDate.SelectedValue, this.txtTransferDate2.Text.Trim());
                }
                return "";
            }
        }

        public string TransferID
        {
            get
            {
                if (!string.IsNullOrEmpty(this.txtTransferID.Text.Trim()))
                {
                    return base.GetParamsString(this.txtTransferID.Text.Trim(), this.ddlTransferID.SelectedValue);
                }
                return "";
            }
        }
    }
}

